import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsInt, IsArray } from 'class-validator';
import { Transform } from 'class-transformer';

export class AssiginUserDto {
  @ApiProperty({ required: true, description: '组织机构id' })
  @IsInt({ message: '用户id必须为整数' })
  @Transform(value => parseInt(value, 10))
  @IsNotEmpty({ message: '组织结构id不能为空' })
  readonly structId: number;

  @ApiProperty({ required: true, description: '用户' })
  @IsArray({ message: '用户为数组类型' })
  readonly userList: Array<number>;
}
